import { observable, action, toJS } from 'mobx';
import { Toast, WhiteSpace, WingBlank, Button, ListView } from 'weaver-mobile';
import * as Apis from '../../api/remind'
import { ListViewPage, RouteLayout, Reply, SearchAdvanced } from 'weaver-mobile-page';
import { Form } from 'weaver-mobile-page';
export default class RemindItemStore {
    comObj = {};
    params = {};
    @observable sellChanceId = "";
    @observable contactid = "";
    @observable workPlanId = "";
    @observable receivecof = "";
    @observable senderName = "";
    @observable senderNamespan = "";
    @observable senderAvator = "";
    @observable title = "";
    @observable createtime = "";
    @observable content = "";
    @observable type = "";
    @observable titlespan = "";
    @observable senderAvatorspan = "";
    @observable id = "";
    @observable role = "";
    @observable contactLogLayout = {};
    @observable createdate = "";
    @observable sender = "";
    @observable isUnder = "";
    @observable receverSpan = "";
    @observable receiver = "";
    @observable timedSende = "";
    @observable timedSendeState = "";
    @observable isSystem = "";
    @observable sellchanceidspan = "";
    @observable contacter = "";
    @observable contacterSpan = "";
    @observable customerSpan = "";
    @observable customer = "";
    @observable sellchancespan = "";
    @action
    doNew = (comObj) => {
        this.comObj = comObj;
        const { isUnderspan, sender, sellchanceid, contactid, workPlanId, receivecof, senderName, senderNamespan, senderAvator, title, createtime, content, type,
            titlespan, createdate, senderAvatorspan, id, rolespan, isSystem, timedSende, timedSendeState, receiverNamespan, receive,
            sellchanceidspan, contacter, contacterSpanspan, customer, customerSpanspan, sellchancespan } = comObj.props.data;
        this.sellChanceId = sellchanceid;
        this.contactid = contactid;
        this.workPlanId = workPlanId;
        this.receivecof = receivecof;
        this.senderName = senderName;
        this.senderNamespan = senderNamespan;
        this.senderAvator = senderAvator;
        this.title = title;
        this.createtime = createtime;
        this.content = content;
        this.type = type;
        this.titlespan = titlespan;
        this.senderAvatorspan = senderAvatorspan;
        this.id = id;
        this.role = rolespan;
        this.sender = sender;
        this.createdate = createdate;
        this.isUnder = isUnderspan;
        let currentPath = comObj.props.obj.props.location.pathname;
        this.isSystem = isSystem;
        this.timedSende = timedSende;
        this.timedSendeState = timedSendeState;
        this.receverSpan = receiverNamespan;
        this.receiver = receive;
        this.sellchanceidspan = sellchanceidspan;
        this.contacter = contacter;
        this.contacterSpan = contacterSpanspan;
        this.customerSpan = customerSpanspan;
        this.customer = customer;
        this.sellchancespan = sellchancespan;
    }
    /**
     * 确认商机
     * 1 只有商机接收人能够确认
     * 
     */
    @action
    saveRemindConf = (params) => {
        Apis.saveRemindConf({ id: this.id }).then(data => {
            this.receivecof = "1";
        });
    }
}